<?php 
use yii\helpers\Html;
use app\components\Lcms;
?><script>
    var share=new function(){
        this.title='<?php echo Html::encode($this->context->title); ?>';
        this.desc='<?php echo Html::encode($this->context->desc); ?>';
        this.url='<?php echo Html::encode($this->context->url); ?>';
        this.img='<?php echo Html::encode($this->context->img); ?>'; 
        this.weibo='<?php echo Html::encode($this->context->title); ?>';
        this.up_data=function(){};
        this.get_type='<?= Lcms::get_browser() ?>';
        this.tongji=<?= $this->context->tongji; ?>;
       }; 
       
</script>
<?php if($this->context->API_share===false){ ?>
<div class="share_wx" onclick="sh.share_wx_close();"><div class="ico"></div></div>
 <link rel="stylesheet" href="<?= Lcms::getWeb() ?>public/lcms/share/share.css<?php // echo '?fdsa='.time() ?>">
<?php }else{ ?>
  <script type="text/javascript" src="<?= $this->context->API_share ?>"></script>
  <script>
  $(function(){
          <?php
    
    $browser=Lcms::get_browser();
    //var_dump($browser);exit;
  if($browser&&($browser==Lcms::APP_music||$browser==Lcms::APP_read)){
      ?>ApiShare.setBrowser('<?= $browser ?>');<?php
  }
  //  ApiShare.setBrowser(ApiShare.Browser.YUEDU);
  ?> 
    
      ApiShare.setShareData({
           title:share.title,
        desc:share.desc,
        img:share.img,
        url:share.url,
        weibo:share.title
      });
  });
  </script>
<?php } ?>
